<script lang="ts" setup>
import { ref } from "vue";
import Child from './Child.vue'
defineOptions({
    name: "index",
});
//--================= Data
let toy = ref("")

//--================= Methods
function test(value: any) {
    //console.log(value);
    toy.value = value
}

//--================= Other

</script>

<template>
    <div class="main">
        <h3>父组件</h3>
        <h4 v-if="toy">子组件通过点击来的数据：{{ toy }}</h4>
        <!-- <button @click="test"> 点我</button> -->
        <Child @test="test" />
    </div>
</template>

<style scoped>
.main {
    background-color: #eee;
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 0 10px;
    min-height: 500px;
}
</style>
